package com.project.service.impl;

import com.project.bean.CutPageBean;
import com.project.bean.ProductBean;
import com.project.dao.IProductDao;
import com.project.dao.ISpeakDao;
import com.project.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements IProductService {
    @Autowired
    private IProductDao productDao;
    @Autowired
    private ISpeakDao speakDao;
    @Override
    public CutPageBean<ProductBean> findByItem(int pageNO, String name) {
        return productDao.findByItem(pageNO,name);
    }

    @Override
    public ProductBean findById(Integer id) {
        ProductBean product = productDao.findById(id);
        product.setSpeakList(speakDao.findByProduct(id));

        return product;
    }
}
